<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    ul{
        height: 30px;
    }
    li{
        float: left;
        list-style: none;
        width: 100px;
        text-align: center;
        height: 20px;
    }
    h3{
        width: 350px;
        height: 30px;
        text-align: center;
        line-height: 30px;
        background-color: skyblue;
        margin-left: 50px;
    }
</style>
<body>
    <div id="app">
        <ul>
            <li v-for="(index,item) in arr" @click="get(item)">{{index}}</li>
        </ul>
            <h3  v-if="num===0">选项卡1
            </h3>
            <h3  v-if="num===1">选项卡2
            </h3>
            <h3  v-if="num===2">选项卡3
            </h3>
            <h3  v-if="num===3">选项卡4
            </h3>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
    <script>

        new Vue({
            // 元素
            el: "#app",
            // 定义的数据(状态)
            data: {
                arr:[1,2,3,4],
                num : 0
            },
            methods:{
                get(item){
                   this.num=item
                }
            }
        })
    </script>
</body>
</html>